<template>
  <div id="app">
    <router-view v-if="isRouterAlive"></router-view>
  </div>
</template>

<script>
import { provide, ref, nextTick } from "vue";
export default {

  name: "app",
  setup() {
    // 刷新
    const isRouterAlive = ref(true);
    const reload = () => {
      isRouterAlive.value = false;
      nextTick(() => {
        isRouterAlive.value = true;
      });
    };
    provide("reload", reload);

    // 暴露数据
    return {
      isRouterAlive,
    };
  },
};
</script>

<style lang="scss"></style>
